package com.totem.base.model;

import lombok.Getter;

import java.util.Objects;


public enum StateEnum {
    STOP("STOP"),
    NORMAL("NORMAL");

    @Getter
    private final String code;

    StateEnum(String code){
        this.code = code;
    }

    public static StateEnum getByCode(String code) {
        for (StateEnum e: StateEnum.values()) {
            if (Objects.equals(code, e.getCode())) {
                return e;
            }
        }
        return null;
    }
}
